package cn.cyb.server.controller;

import cn.cyb.server.domain.AjaxResult;
import cn.cyb.server.domain.PageResult;
import cn.cyb.server.domain.entity.SysUser;
import cn.cyb.server.service.ISysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author yuebo
 * @date 2025/3/4
 */
@RestController
@RequestMapping("/system/user")
public class SysUserController extends BaseController {


    @Autowired
    private ISysUserService sysUserService;

    @GetMapping("/list")
    public AjaxResult<PageResult<SysUser>> list() {
        int count = sysUserService.getCount();
        List<SysUser> sysUsers = sysUserService.selectUserList();
        return AjaxResult.success(new PageResult<>(count, sysUsers));
    }
}
